package com.yuyu.service.impl;

import com.yuyu.bean.OrderItem;
import com.yuyu.mapper.OrderItemMapper;
import com.yuyu.service.OrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("orderItemService")
@Transactional
public class OrderItemServiceImpl implements OrderItemService {
    @Autowired
    private OrderItemMapper orderItemMapper;

    @Override
    public List<OrderItem> findOrderItemWithOrderId(Integer id) {
        return orderItemMapper.findOrderItemWithOrderId(id);
    }

    @Override
    public int addOrderItem(OrderItem orderItem) {

        return orderItemMapper.addOrderItem(orderItem);
    }

    @Override
    public int deleteOrderItemById(List<Integer> list) {
        return orderItemMapper.deleteOrderItemById(list);
    }

    @Override
    public int editOrderItem(OrderItem orderItem) {
        return orderItemMapper.editOrderItem(orderItem);
    }
}
